package com.duang.framework.service;

/**
 * @author Administrator
 *
 */
public final class CacheUtils {
	
	
	public static String getMethodCacheKey(Object[] arguments){
		StringBuilder sb = new StringBuilder();
		if ((arguments != null) && (arguments.length != 0)) {
			for (int i = 0; i < arguments.length; i++) {
				sb.append(".").append(arguments[i]);
			}
		}
		return sb.toString();
	}
	
	/**
	 * @deprecated
	 * @param targetName
	 * @param methodName
	 * @param arguments
	 * @return
	 */
	public static String getCacheKey(String targetName, String methodName,
			Object[] arguments) {
		StringBuilder sb = new StringBuilder();
		sb.append(targetName).append(".").append(methodName);
		if ((arguments != null) && (arguments.length != 0)) {
			for (int i = 0; i < arguments.length; i++) {
				sb.append(".").append(arguments[i]);
			}
		}
		return sb.toString();
	}
}
